﻿#region License statement
// NJamb, a specification and delta-specification DSL
// Copyright (c) 2010-2011, Mark Knell
// Published under the MIT License; all other rights reserved
#endregion

#region using...
using System.Collections.Generic;
using NJamb.Parser.SpecificationBuilders.SubjectIs.AbstractEnumerable;
using NJamb.Specifications.Simple.Enumerable;
using Stile.Patterns.SelfDescribingPredicates;
#endregion

namespace NJamb.Parser.SpecificationBuilders.SubjectIs.Simple.Enumerable
{
    public class NegatableEnumerableIs<TSubject, TItem> :
        EnumerableIs<TSubject, TItem, IEnumerableSpecification<TSubject, TItem>, ISimpleEnumerableIs<TSubject, TItem>>,
        INegatableEnumerableIs<TSubject, TItem>,
        ISimpleEnumerableIs<TSubject, TItem>
        where TSubject : class, IEnumerable<TItem>
    {
        public NegatableEnumerableIs(
            ICollaboratingSpecificationBuilder<TSubject, IEnumerableSpecification<TSubject, TItem>> specificationBuilder,
            Negated negated)
            : base(specificationBuilder, negated) {}

        protected override ISimpleEnumerableIs<TSubject, TItem> FactoryForNegation(
            ICollaboratingSpecificationBuilder<TSubject, IEnumerableSpecification<TSubject, TItem>> specificationBuilder,
            Negated negated)
        {
            return new NegatableEnumerableIs<TSubject, TItem>(specificationBuilder, negated);
        }
    }
}
